home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / biz / swood / fw_mef_e.lha / FW_MEf-e / ISeveral_V3.fw.long < prev    next >
Text File  |  1997-04-27  |  5KB  |  249 lines

  1. /* ============================================ */
  2. /* Final Writer Arexx Macro - Mehrfach Einfügen */
  3. /* This macro will duplicate any selected       */
  4. /* graphic objects. (group or ungroup)          */
  5. /* by Heiko Schröder (Age Ass)                  */
  6. /* $VER: Insert Several 1.5 (97/04/27)          */
  7. /* DocItemPrefs Abfrage                         */
  8. /* ============================================ */
  9. R='0A'X
  10. Dre=0
  11. Sei=0
  12.  
  13. Address='FinalW'
  14. Options results
  15.  
  16. STATUS PORTNAME
  17. FW = result
  18. address = FW
  19.  
  20. SIGNAL ON BREAK_C
  21. SIGNAL ON SYNTAX
  22.  
  23. 'ShowMessage 2 1 "Insert Several V1.5e - 97/04/27" "© Heiko Schroeder" "E-Mail: age@thepentagon.com" "(-:" "Ok" "(-:"'
  24.  
  25. GetDocItemPrefs Decimal
  26. Punkt=Result
  27. If Punkt="Comma" then DocItemPrefs Decimal Period
  28.  
  29. GraphicTool
  30. Ungroup
  31. nr=1
  32. CurrentObject
  33. ObjectId = Result
  34. IF ObjectId=0 THEN do
  35.    'ShowMessage 1 1 "Macro: Insert Several" "A B O R T" "No graphical object selected..." "Okay" "" ""'
  36.    Call BREAK_C
  37. End
  38.  
  39. /*Kontrolle ob ein oder mehrere Objekte ausgewählt sind*/
  40.  
  41. Objekt.0=nr; Objekt.nr=ObjectID
  42. FirstObject Selected
  43. ID=result
  44. Call Zaehlen
  45. Do While 1
  46.    NextObject ID Selected
  47.    ID=result
  48.    If ID=0 then Leave
  49.    Call Zaehlen
  50. End
  51.  
  52. If Objekt.0=1 then do
  53.    gruppe=false
  54. end
  55. else gruppe=true
  56.  
  57. /*Ende der Kontrolle*/
  58.  
  59. STATUS View
  60. Zoom=result
  61.  
  62. STATUS Pages
  63. Seiten=result
  64.  
  65. STATUS Page
  66. Seite=result
  67. kx=9999
  68. ky=9999
  69. If Gruppe=true then
  70.    Do a=1 to Objekt.0
  71.    GetObjectCoords Objekt.a
  72.    Parse var result Soite ax ay rest
  73.    if ax<kx then kx=ax
  74.    if ay<ky then ky=ay
  75. end
  76.  
  77. Do a=2 to Objekt.0
  78.    SelectObject Objekt.a MULTIPLE
  79. End
  80. SelectObject Objekt.1 MULTIPLE
  81.  
  82. If Gruppe=true then Group
  83.  
  84. Copy
  85. IF RC=0 THEN do
  86.    CurrentObject
  87.    ObjectID=result
  88.    GetObjectCoords ObjectID
  89.    Parse var result Seite x y w h
  90.    wl=w
  91.    hl=h
  92.    if Gruppe=true then do
  93.       x=kx; y=ky
  94.    End
  95.    GetObjectRotation ObjectID
  96.    Dreh=result
  97.    GetObjectType ObjectID
  98.    Typ=result
  99.  
  100.    If Typ=2|Typ=3 then do
  101.       If Seite~=1 then do
  102.          'ShowMessage 1 1 "FW has problems with lines outside" "the page 1... CANCEL" "" "Okay" "" ""'
  103.          Call BREAK_C
  104.       End
  105.    End
  106.    If Gruppe=true then Group
  107.  
  108.    'ShowMessage 1 0 "Screen output?" "" "" "normal" "speed" ""'
  109.    ba=result
  110.  
  111.    IF ba=2 THEN DO
  112.       status WINDOW
  113.       parse VAR result links oben width height minwidth minheight maxwidth maxheight
  114.       sizewindow minwidth minheight
  115.    End
  116.  
  117.    Do While 1
  118.       Result="ß"
  119.       RequestText '"Insert Several" "Number of copies" ""'
  120.       Anzahl=Result
  121.       If Anzahl="ß" then call Ende1
  122.       If Anzahl=""|Anzahl=0 then call Ende
  123.       If Datatype(Anzahl,'W')=1 then leave
  124.             else call oops
  125.    End
  126.  
  127.    Do while 1
  128.       Result="ß"
  129.       RequestText '"Insert Several" "Horizontal displacement:" ""'
  130.       Hor=Result
  131.       If Hor="ß" then call Ende1
  132.       If Hor="" then Hor=0
  133.       If Datatype(Hor,'N')=1 then leave
  134.             else call oops1
  135.    End
  136.  
  137.    Do while 1
  138.       Result="ß"
  139.       RequestText '"Insert Several" "Vertical displacement:" ""'
  140.       Ver=Result
  141.       If Ver="ß" then call Ende1
  142.       If Ver="" then Ver=0
  143.       If Datatype(Ver,'N')=1 then leave
  144.             else call oops1
  145.    End
  146.  
  147.    If Typ~=2&Typ~=3 then do                     /*Linien*/
  148.       Do while 1
  149.          Result="ß"
  150.          RequestText '"Insert Several" "Rotation:" ""'
  151.          Dre=Result
  152.          If Dre="ß" then call Ende1
  153.          If Dre="" then Dre=0
  154.          If Datatype(Dre,'W')=1 then leave
  155.             else call oops
  156.       End
  157.  
  158.       Do While 1
  159.          Result="ß"
  160.          RequestText '"Insert Several" "On which page? 0=selected page" ""'
  161.          Sei=Result
  162.          If Sei="ß" then call Ende1
  163.          If Sei=""|Sei=0 then Sei=Seite
  164.          If Datatype(Sei,'W')=1 then leave
  165.             else call oops
  166.       End
  167.    end
  168.  
  169.    s=Sei-Seiten
  170.  
  171.    Do a=1 to s
  172.       InsertPageBreak
  173.    End
  174.       
  175.    If ba=2 then View 20
  176.    Do i=1 TO Anzahl
  177.       Paste
  178.       CurrentObject
  179.       ObjectID=Result
  180.       a=x+(Hor*i)
  181.       b=y+(Ver*i)
  182.       Winkel=Dreh+Dre*i
  183.       If Typ=2|Typ=3 then do                     /*Linien*/
  184.          w=wl+(Hor*i)
  185.          h=hl+(Ver*i)
  186.          Sei=Seite
  187.       End
  188.       SetObjectCoords ObjectID Sei a b w h    /*Probleme bei Linien*/
  189.       SetObjectRotation ObjectID Winkel
  190.       If Gruppe=true then Group
  191.    End
  192. End
  193. Redraw
  194.  
  195. Call WH
  196.  
  197. 'ShowMessage 2 1 "Thanks for using." "" "" "@-`-" "Please" ":-))"'
  198. Exit
  199.  
  200. ENDE:
  201.    Call WH
  202.    'ShowMessage 1 1 "Incorrect number of copies..." "A B O R T" "" "Okay" "" ""'
  203.    EXIT
  204.  
  205. ENDE1:
  206.    Call WH
  207.    'ShowMessage 1 1 "You have cancelled..." "© Heiko Schröder" "http://yi.com/home/SchroederHeiko" "Okay" "" ""'
  208.    EXIT
  209.  
  210. SYNTAX:
  211.    Call WH
  212.    'ShowMessage 1 1 "There was an error." "Error-identification you can find in »Ram:Error«" "" "Okay" "" ""'
  213.    address "REXX"
  214.    Open("F","Ram:Error","W")
  215.    write ("F", "ATTENTION! FW_MEf V1.5e-Error")
  216.    write ("F",'Error in line' SIGL ':' ERRORTEXT(RC))
  217.    write ("F", 'Please report the author. » s93324@fh-telekom-leipzig.de «'||R||R)
  218.    Close ("F")
  219. EXIT
  220.  
  221. BREAK_C:
  222.    Call WH
  223.    'ShowMessage 1 1 "Macro-Break..." "" "" "I know..." "" ""'
  224.    EXIT
  225.  
  226. WH:
  227.    If ba=2 then do
  228.       GoToPage Sei
  229.       View Zoom
  230.       sizewindow width height
  231.    End
  232.    If Punkt="Comma" then DocItemPrefs DECIMAL Comma
  233. Return
  234.  
  235. Zaehlen:
  236. If ID~=Objekt.1 then do
  237.    nr=nr+1
  238.    Objekt.0=nr; Objekt.nr=ID
  239. End
  240. Return
  241.  
  242. oops:
  243. 'ShowMessage 1 1 "Input error!" "" "" "Okay" "" ""'
  244. return
  245.  
  246. oops1:
  247. 'ShowMessage 1 1 "Input error!" "Please use (.) !" "" "Okay" "" ""'
  248. return
  249.